/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package object;

import java.util.ArrayList;

/**
 *
 * @author Le Thai
 */
public class DsNamHoc {
    private ArrayList<NamHoc> dsNamHoc=new ArrayList<>();
    
    public DsNamHoc(){
        
    }
 
    public DsNamHoc(ArrayList<NamHoc> dsnamhoc){
        this.dsNamHoc=dsnamhoc;
    }
    
    public int timMaNamHoc(String namhoc){
        for(NamHoc nh:getDsNamHoc()){
            if(nh.getTenNh().equals(namhoc))
                return nh.getMaNh();
        }
        return 0;
    }

    /**
     * @return the dsNamHoc
     */
    public ArrayList<NamHoc> getDsNamHoc() {
        return dsNamHoc;
    }

    /**
     * @param dsNamHoc the dsNamHoc to set
     */
    public void setDsNamHoc(ArrayList<NamHoc> dsNamHoc) {
        this.dsNamHoc = dsNamHoc;
    }
}
